<!DOCTYPE html>
<body>
<script src="../../resources/js-test.js"></script>
<script>

description('This tests that Text is constructable.');

shouldBe('new Text("one").data', '"one"');
shouldBe('new Text().data', '""');
shouldBe('new Text(undefined).data', '""');
shouldBe('new Text(null).data', '"null"');
shouldBe('new Text("two").ownerDocument', 'document');

shouldBe('typeof new Text', '"object"');
shouldBe('Object.prototype.toString.call(new Text)', '"[object Text]"');
shouldBeTrue('new Text instanceof Text');
shouldBe('Object.getPrototypeOf(new Text)', 'Text.prototype');

var frame = document.createElement('iframe');
document.body.appendChild(frame);
var innerWindow = frame.contentWindow;
var innerDocument = frame.contentDocument;

shouldBe('new innerWindow.Text("three").ownerDocument', 'innerDocument')
shouldBeTrue('new innerWindow.Text instanceof innerWindow.Text');
shouldBe('Object.getPrototypeOf(new innerWindow.Text)', 'innerWindow.Text.prototype');

</script>
